<template>
	<view>
		<block v-for="(item,index) in List" :key='index'>
			<view class="signUp_item">
				<view>
					<view>
						<image src="../../static/img/iscertificate.png" mode="widthFix" style="width: 100rpx;"></image>
					</view>
					<view style="width: 70%;">
						<view>{{item.name}}</view>
						<view style="display: flex;justify-content: space-between;">
							<text>2020-07-24</text>
							<text v-if="item.state === 100 && item.examDateTime !== null" style="font-size: 35rpx;font-weight: 600;color: #5adc70;">
								成绩：{{item.examResul}}
							</text>
						</view>
					</view>
				</view>
				<view >
					<view v-if="item.state === 100 && item.examDateTime === null">
						模拟考试
					</view>
					<view v-if="item.state === 100 && item.examDateTime === null" style="background: #a7a0f6;color: #FFFFFF;" @click="toText(item.id)">
						去考试
					</view>
					<view v-if="item.state === 0" style="background: #ffcc33;color: #FFFFFF;">
						去支付
					</view>
				</view>
				<u-gap height="20" bg-color="#f2f2f2"></u-gap>
			</view>
		</block>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				List:[
					{
						img:'../../static/img/iscertificate.png',
						type:1,
						title:'35KV以下配电线路工',
						time:'2020-07-24',
					},
					{
						img:'../../static/img/iscertificate.png',
						type:2,
						title:'35KV以下配电线路工',
						time:'2020-07-24',
					},
					{
						img:'../../static/img/iscertificate.png',
						type:3,
						title:'35KV以下配电线路工',
						time:'2020-07-24',
						cj:'99'
					}
				]
			}
		},
		onLoad() {
			this.getmyRegistration();
		},
		methods: {
			toText(id){
				uni.navigateTo({
					url:`./exam?id=${id}`
				})
			},
			getmyRegistration(){
				this.$u.api.getmyRegistration().then(res => {
					if(res.data.data){
						this.List = res.data.data;
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.signUp_item{
	>view{
		&:nth-child(1){
			width: 100%;
			display: flex;
			padding: 60rpx 20rpx 20rpx 20rpx;
			border-bottom: 1rpx solid #EEEEEE;
			>view{
				margin-left: 20rpx;
				display: flex;
				flex-flow: column;
				&:nth-child(2){
					>view{
						&:nth-child(1){
							font-weight: 900;
						}
						&:nth-child(2){
							font-size: 30rpx;
							margin-top: 10rpx;
						}
					}
				}
			}
		}
		&:nth-child(2){
			display: flex;
			justify-content: flex-end;
			padding: 20rpx;
			>view{
				padding: 20rpx 40rpx;
				font-size: 30rpx;
				padding: 15rpx 50rpx;
				border: 1rpx solid #9f9f9f;
				border-radius: 50rpx;
				margin-right: 30rpx;
			}
		}
	}
}
</style>
